import request from "./request";
var util = require("./util.js");
const baseUrl = "https://www.hqzy.net/manbin/";
// const baseUrl = "http://192.168.0.200:7070/";
// const baseUrl = "http://120.46.175.235:7070/manbin/";
const urlPrefix = "chronicdisease/";

request.config.baseURL = baseUrl;
request.config.urlPrefix = urlPrefix;

function fail(res) {
  return res;
}
function success(res) {
  return res;
}

const api = {
  baseUrl,
  urlPrefix,
  //验证码登录
  login: (data) => request.post("login", data).then(success).catch(fail),
  //wx.login登录
  loginByWxOuth: (data) => request.post("loginByWxOuth", data).then(success).catch(fail),
  //解密手机号
  loginByPhoneAndBind: (data) => request.post("loginByPhoneAndBind", data).then(success).catch(fail),
  //查询用户角色
  getUserRoles: (data) => request.post("getUserRoles", data).then(success).catch(fail),
  //医生端
  //医生端
  //医生端
  //首页数据
  doctorGetHomeInfo: (data) => request.post("doctor/getHomeInfo", data).then(success).catch(fail),
  //患者列表
  doctorMyPatientList: (data) => request.post(`doctor/myPatientList`, data).then(success).catch(fail),
  //患者档案
  doctorPatientDetail: (data) => request.post(`doctor/patientDetail`, data).then(success).catch(fail),
  //民族数据
  doctorListNation: (data) => request.post(`doctor/listNation`, data).then(success).catch(fail),
  //病类数据
  doctorListDiseaseCategory: (data) => request.post(`doctor/listDiseaseCategory`, data).then(success).catch(fail),
  //添加患者
  doctorAddPatient: (data) => request.post(`doctor/addPatient`, data).then(success).catch(fail),
  //发送验证码
  doctorSendSmsCodet: (data) => request.post(`doctor/sendSmsCode`, data).then(success).catch(fail),
  //关注/取关患者
  doctorFollowPatient: (data) => request.post(`doctor/followPatient`, data).then(success).catch(fail),
  //医生列表
  doctorList: (data) => request.post(`doctor/doctorList`, data).then(success).catch(fail),
  //更换医生
  doctorChangeDoctor: (data) => request.post(`doctor/changeDoctor`, data).then(success).catch(fail),
  //更换医生审核详情
  doctorGetChangeDoctorResult: (data) => request.post(`doctor/getChangeDoctorResult`, data).then(success).catch(fail),
  //设备列表
  doctorBindDeviceList: (data) => request.post(`doctor/bindDeviceList`, data).then(success).catch(fail),
  //设备详情
  doctorGetDeviceDetailByScanCode: (data) =>
    request.post(`doctor/getDeviceDetailByScanCode`, data).then(success).catch(fail),
  //绑定设备
  doctorBindDevice: (data) => request.post(`doctor/bindDevice`, data).then(success).catch(fail),
  //更换绑定设备
  doctorBindDeviceChange: (data) => request.post(`doctor/bindDeviceChange`, data).then(success).catch(fail),
  //患者测量数据列表
  doctorBloodPressureTestList: (data) => request.post(`doctor/bloodPressureTestList`, data).then(success).catch(fail),
  //患者测量数据趋势图
  doctorBloodPressureTestTrendChart: (data) =>
    request.post(`doctor/bloodPressureTestTrendChart`, data).then(success).catch(fail),
  //医生个人信息
  doctorDetail: (data) => request.post(`doctor/doctorDetail`, data).then(success).catch(fail),
  //科室，职务列表
  doctorDictDataForDoctor: (data) => request.post(`doctor/dictDataForDoctor`, data).then(success).catch(fail),
  //医生个人信息-修改保存
  doctorUpdateDoctor: (data) => request.post(`doctor/updateDoctor`, data).then(success).catch(fail),
  //患者提醒/患者关怀-列表
  doctorRemindList: (data) => request.post(`doctor/remindList`, data).then(success).catch(fail),
  //患者提醒常用语
  doctorRemindWordsList: (data) => request.post(`doctor/remindWordsList`, data).then(success).catch(fail),
  //患者提醒紧急联系人
  doctorListFamily: (data) => request.post(`doctor/listFamily`, data).then(success).catch(fail),
  //患者提醒新增
  doctorAddRemind: (data) => request.post(`doctor/addRemind`, data).then(success).catch(fail),
  //患者关怀常用语
  doctorCareReasonList: (data) => request.post(`doctor/careReasonList`, data).then(success).catch(fail),
  //患者关怀处理
  doctorHandleCareMsg: (data) => request.post(`doctor/handleCareMsg`, data).then(success).catch(fail),
  //患者评价-统计
  doctorCuntEvaluate: (data) => request.post(`doctor/countEvaluate`, data).then(success).catch(fail),
  //系统推送
  doctorSysMsgList: (data) => request.post(`doctor/sysMsgList`, data).then(success).catch(fail),
  //系统推送修改为已读
  doctorUpdateSysMsgRead: (data) => request.post(`doctor/updateSysMsgRead`, data).then(success).catch(fail),
  //单个患者的评价列表
  doctorEvaluateList: (data) => request.post("doctor/evaluateList", data).then(success).catch(fail),

  //患者端
  //患者端
  //患者端
  //首页数据
  patientGetHomeInfo: (data) => request.post("patient/getHomeInfo", data).then(success).catch(fail),
  //修改患者信息
  patientUpdatePatient: (data) => request.post("patient/updatePatient", data).then(success).catch(fail),
  //修改亲友
  patientSaveFamily: (data) => request.post("patient/saveFamily", data).then(success).catch(fail),
  //添加亲友
  patientAddFamily: (data) => request.post("patient/saveFamily", data).then(success).catch(fail),
  //删除亲友
  patientDelFamily: (data) => request.post("patient/delFamily", data).then(success).catch(fail),
  //亲友关系
  patientRelationList: (data) => request.post("patient/relationList", data).then(success).catch(fail),
  //给医生评分
  patientEvaluateDoctor: (data) => request.post("patient/evaluateDoctor", data).then(success).catch(fail),
  //修改医生提醒为已读
  patientUpdateRemindRead: (data) => request.post("patient/updateRemindRead", data).then(success).catch(fail),
 
};
export default api;
